]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
grabHelper: Track the grab before trying to set key focus
authorJasper St. Pierre <jstpierre@mecheye.net>
Sat, 16 Feb 2013 17:52:37 +0000 (12:52 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Sat, 16 Feb 2013 18:33:45 +0000 (13:33 -0500)
If we don't this for a nested grabFocus grab, the notify::key-focus
will be called, not think that the new key focus is part of the
grab, and cancel the full grab. This leaves the grab helper in an
inconsistent and confused state, as the grab is pushed onto the
grab stack after.

https://bugzilla.gnome.org/show_bug.cgi?id=693975

js/ui/grabHelper.js

index 058524ae8a3eb4a35073f4b06e1e8730e9ba40e1..e31cc2f1809aca2461c1192a12c9bbff9f83fc68 100644 (file)
@@ -167,6 +167,8 @@ const GrabHelper = new Lang.Class({
         if (params.grabFocus && !this._takeFocusGrab(hadFocus))
             return false;
 
+        this._grabStack.push(params);
+
         if (params.focus) {
             params.focus.grab_key_focus();
         } else if (newFocus && (hadFocus || params.grabFocus)) {
@@ -177,7 +179,6 @@ const GrabHelper = new Lang.Class({
         if ((params.grabFocus || params.modal) && !this._capturedEventId)
             this._capturedEventId = global.stage.connect('captured-event', Lang.bind(this, this._onCapturedEvent));
 
-        this._grabStack.push(params);
         return true;
     },